﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestJQ.aspx.cs" Inherits="Sport.TestJQ" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.9.1.js"></script>
    <script type="text/javascript">
        function PrepareNOpenDialog() {
            alert('');
            $('#divMemoInfo').dialog(); //init the dialog (consider div as a dialog)
            $('#divMemoInfo').dialog('close'); //prevent the dialog from showing after initiation
            $('#divMemoInfo').load('Memo.ascx');
            dialogOptions = {
                modal: true,
                buttons: {
                    'Close': function() {
                        $(this).dialog('close');
                    }
                },
                minWidth: 400,
                minHeight: 200,
                width: $(window).width() / 3 //'auto'
                ,
                height: 'auto'
            };

            //open dialog when image clicked
            $('#btnMemo').click(function() {
                $('#divMemoInfo').dialog(dialogOptions);
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:ImageButton ID="btnMemo" runat="server"  AlternateText="Memo" CausesValidation="false"    
     OnClientClick="PrepareNOpenDialog()" ClientIDMode ="Static" />
    <div id="divMemoInfo" title="Memo"></div>
    </div>
    </form>
</body>
</html>
